From 43aa5ed8c07cf9772cea872cde6adb6c4eef6095 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sat, 7 Jul 2007 10:31:15 +0100 Subject: [PATCH] Specify -fno-strict-aliasing in root build config file. Fixes correctness issues with xenstored and gcc-4.2. Original patch by Charles Coffing Signed-off-by: Keir Fraser --- Config.mk | 7 +++++-- tools/blktap/drivers/Makefile | 1 - tools/blktap/lib/Makefile | 2 +- tools/libxc/Makefile | 1 - tools/xcutils/Makefile | 2 +- xen/arch/ia64/Rules.mk | 2 +- xen/arch/powerpc/Rules.mk | 2 +- xen/arch/x86/Rules.mk | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Config.mk b/Config.mk index c77f6ae020..4e2977a626 100644 --- a/Config.mk +++ b/Config.mk @@ -17,8 +17,9 @@ CONFIG_$(XEN_OS) := y SHELL ?= /bin/sh # Tools to run on system hosting the build -HOSTCC = gcc -HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCC = gcc +HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS += -fno-strict-aliasing DISTDIR ?= $(XEN_ROOT)/dist DESTDIR ?= / @@ -58,6 +59,8 @@ else CFLAGS += -g endif +CFLAGS += -fno-strict-aliasing + CFLAGS += -std=gnu99 CFLAGS += -Wall -Wstrict-prototypes diff --git a/tools/blktap/drivers/Makefile b/tools/blktap/drivers/Makefile index c077c7221e..fca48b6ced 100644 --- a/tools/blktap/drivers/Makefile +++ b/tools/blktap/drivers/Makefile @@ -10,7 +10,6 @@ LIBAIO_DIR = ../../libaio/src CFLAGS += -Werror CFLAGS += -Wno-unused -CFLAGS += -fno-strict-aliasing CFLAGS += -I $(XEN_LIBXC) -I $(LIBAIO_DIR) CFLAGS += $(INCLUDES) -I. -I../../xenstore CFLAGS += -D_GNU_SOURCE diff --git a/tools/blktap/lib/Makefile b/tools/blktap/lib/Makefile index 833887ade0..f5621e1e23 100644 --- a/tools/blktap/lib/Makefile +++ b/tools/blktap/lib/Makefile @@ -16,7 +16,7 @@ SRCS += xenbus.c blkif.c xs_api.c CFLAGS += -Werror CFLAGS += -Wno-unused -CFLAGS += -fno-strict-aliasing -fPIC +CFLAGS += -fPIC # get asprintf(): CFLAGS += -D _GNU_SOURCE diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index ddf99ed684..102653ff95 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -57,7 +57,6 @@ GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_powerpc.c -include $(XEN_TARGET_ARCH)/Makefile CFLAGS += -Werror -Wmissing-prototypes -CFLAGS += -fno-strict-aliasing CFLAGS += $(INCLUDES) -I. -I../xenstore # Needed for posix_fadvise64() in xc_linux.c diff --git a/tools/xcutils/Makefile b/tools/xcutils/Makefile index f8ac92f7d9..df7ee8613f 100644 --- a/tools/xcutils/Makefile +++ b/tools/xcutils/Makefile @@ -15,7 +15,7 @@ PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE) -CFLAGS += -Werror -fno-strict-aliasing +CFLAGS += -Werror CFLAGS += $(INCLUDES) # Make gcc generate dependencies. diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk index cfc333ee85..389563166e 100644 --- a/xen/arch/ia64/Rules.mk +++ b/xen/arch/ia64/Rules.mk @@ -18,7 +18,7 @@ endif # Used only by linux/Makefile. AFLAGS_KERNEL += -mconstant-gp -nostdinc $(CPPFLAGS) -CFLAGS += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing +CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -mconstant-gp #CFLAGS += -O3 # -O3 over-inlines making debugging tough! CFLAGS += -O2 # but no optimization causes compile errors! diff --git a/xen/arch/powerpc/Rules.mk b/xen/arch/powerpc/Rules.mk index f395e88df5..fd26632ae6 100644 --- a/xen/arch/powerpc/Rules.mk +++ b/xen/arch/powerpc/Rules.mk @@ -9,7 +9,7 @@ C_WARNINGS := -Wredundant-decls # _no_ common code can have packed data structures or we are in touble. C_WARNINGS += -Wpacked -CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common -fno-strict-aliasing +CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common CFLAGS += -iwithprefix include -Wall -Werror -pipe CFLAGS += -I$(BASEDIR)/include CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 97e376a4ab..9296afd9d9 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -17,7 +17,7 @@ ifneq ($(XEN_OS),SunOS) CFLAGS += -nostdinc endif -CFLAGS += -fno-builtin -fno-common -fno-strict-aliasing +CFLAGS += -fno-builtin -fno-common CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe CFLAGS += -I$(BASEDIR)/include CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic -- 2.30.2